<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
use DB;

class Photo extends Model{
	//获取轮播图信息
	public function select(){
		$res = DB::table("advert")->select("adv_id","name","image","url","is_show")->where("type","0")->paginate(2);
		return $res;
	}
	//插入轮播图
	public function insert($data){
		$res = DB::table("advert")->insert($data);
		return $res;
	}
	//获取单条数据
	public function getOne($adv_id){
		$res = DB::table("advert")->where("adv_id",$adv_id)->first();
		return $res;
	}
	//编辑轮播图
	public function lists_up($data,$adv_id){
		$res = DB::table("advert")->where("adv_id",$adv_id)->update($data);
        return $res;
	}
	//删除轮播图
	public function lists_del($adv_id,$data){
		$res = DB::table("advert")->where("adv_id",$adv_id)->update($data);
		return $res;
	}


}